<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title>后台管理</title>
  <!-- 所有script封装到一起 -->
  <div th:replace="recordAdmin/common/scriptBar :: script"  ></div>
</head>
<body id="page-top">
<div id="wrapper" class="set-min-height">
  <div th:replace="recordAdmin/common/leftPageBar :: leftPage"  ></div>
  <div id="content-wrapper" class="d-flex flex-column">
    <!-- 页面开始 -->
    <div id="content">
      <div th:replace="recordAdmin/common/headPageBar :: headPage"  ></div>
      <!-- 页面内容开始 -->
      <div class="container-fluid">
        <div class="row">
        <div class="container-fluid" style="width:60% ">
            <input type="hidden" id="recordAdminId" readonly="readonly" th:value="${session.adminId}" class="form-control form-control-user" aria-describedby="emailHelp">
            <div class="form-group">
                <span> 档案所属人ID： </span>
                <input type="text" id="recordUserId"  class="form-control form-control-user" aria-describedby="emailHelp">
            </div>
            <div class="form-group">
                <span> 档案ID： </span>
                <input type="text" id="recordId"  class="form-control form-control-user" aria-describedby="emailHelp">
            </div>
            <div class="form-group">
                <span> 档案授权时间： </span>
                <input style="background: white" type="text" id="recordAuthTime" readonly="readonly" name="datetimepicker" value=" " placeholder="档案上传时间" class="form-control">
            </div>
            <div class="form-group">
                <span> 档案授权截止时间： </span>
                <input style="background: white" type="text" id="recordAuthCutOffTime" readonly="readonly" name="datetimepicker" value=" " placeholder="档案上传时间" class="form-control">
            </div>
            <div class="form-group">
                <span> 授权描述： </span>
                <textarea type="text" id="recordAuthTips" class="form-control form-control-user" aria-describedby="emailHelp"></textarea>
            </div>
            <p><input class="btn btn-primary btn-user btn-block" id="insertRecordAuth" type="submit" value="上传档案信息"/></p>
        </div>
        </div>
      </div>
      <!-- 页面内容结束 -->

    </div>
    <!-- 页面结束 -->
    <div th:replace="recordAdmin/common/footerBar :: footer"  ></div>
  </div>
</div>
<script type="text/javascript">
    // 时间选择器
    $("input[name='datetimepicker']").datetimepicker({
        forceParse: 0,//设置为0，时间不会跳转1899，会显示当前时间。
        language: 'zh-CN',//显示中文
        format: "yyyy-mm-dd hh:ii",
        minView: 0,//设置只显示到月份
        initialDate: new Date(),//初始化当前日期
        autoclose: true,//选中自动关闭
        todayBtn: true,//显示今日按钮
        linkField: "mirror_field",
        linkFormat: "yyyy-mm-dd hh:ii"
    })
    $("input[name='datetimepicker']").datetimepicker("setDate", new Date() );  //设置显示默认当天的时间

    $("input[id='insertRecordAuth']").click(function(){
        $.post("./insertRecordAuth",
            {"recordAdminId":$("input[id='recordAdminId']").val(),
                "recordUserId":$("input[id='recordUserId']").val(),
                "recordId":$("input[id='recordId']").val(),
                "recordAuthTime":$("input[id='recordAuthTime']").val(),
                "recordAuthCutOffTime":$("input[id='recordAuthCutOffTime']").val(),
                "recordAuthTips":$("textarea[id='recordAuthTips']").val()},
            function(data){
                alert(data['msg']+" ID："+data['data']);
            })
    });
</script>
</body>
</html>
